package xyz.zdsoft.course_manage_module.controller;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RestController;
import xyz.zdsoft.common.utils.Result;
import xyz.zdsoft.course_manage_module.service.InsertStudentToCourseService;
import javax.annotation.Resource;
import java.text.ParseException;

@RestController
@Api(tags = "管理员课程管理")
public class AdminInsertStudentToCourseController {
    @Resource
    private InsertStudentToCourseService insertStudentToCourseService;
    @ApiOperation("课程添加学生")
    @ApiImplicitParams({
            @ApiImplicitParam(name = "courseOnId",value = "课程安排id",required = true),
            @ApiImplicitParam(name = "studentIds",value = "学生id,若有多个则用','隔开",required = true)
    })
    @PostMapping("/InsertStudentToCourse")
    public Result insertStudent(Integer courseOnId, Integer[] studentIds) throws ParseException {
        return insertStudentToCourseService.toStudent(courseOnId,studentIds);

    }
}
